home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Answers 2002 January
/
PC Answers January 2002.7z
/
PC Answers January 2002.bin
/
graphics
/
freepixl
/
_SETUP.1
/
HTMLhelp.pxl
< prev
next >
Wrap
Text File
|
2001-03-22
|
6KB
|
215 lines
{ Filename : HTMLhelp.pxl
Purpose : Demostrate HTMLhelp for PiXCL applications
Date : March 2000
Author: S.Dibbs, VYSOR Integration Inc
History:
Version : 1.0 RELEASE
Update :
Date :
--------------------------------------------------------------------------}
Initialize: {only one instance allowed}
UseCoordinates(PIXEL)
Title$ = "PiXCL 5.0 and HTML Help systems"
WinExist(Title$,Res)
If Res = 0 Then Goto One_Instance
Beep
WinSetActive(Title$,Res)
WinShow(Title$,RESTORE,Res)
End
One_Instance:
UseCaption(Title$) {change the title}
WinLocate(Title$,120,200,523,624,Res)
UseBackground(TRANSPARENT,43,189,225)
WinShow(Title$,NOTOPMOST,Res)
DrawBackGround
DirGet(SourceDir$) {used later for library function calls}
DragAcceptFile(ENABLE,AcceptFile)
AutoProgressBar(DISABLE)
SysCmdEndAt(Terminate)
InfoMenu(REMOVE)
WaitInput(100)
SetMenu("&File",IGNORE,
"&New",CreatingFile,
"&Open",OpeningFile,
"&Save",SavingFile,
SEPARATOR,
"E&xit!",Terminate,
ENDPOPUP,
"&View",IGNORE,
"&ToolBar",ViewToolBar,
"&StatusBar",ViewStatusBar,
ENDPOPUP,
"&Information",IGNORE,
"&Concept",Concept,
"&Help",ShowAppHelp,
SEPARATOR,
"&About",About,
ENDPOPUP)
GoSub MakeToolbar
ChangeMenuItem("&ToolBar",CHECK,TBRes)
StatusWindow(ENABLE,BOTTOM,2,200,-1,0,0)
DrawStatusWinText(0,"Ready")
ChangeMenuItem("&StatusBar",CHECK,SBRes)
UseFont("Arial",9,17,NOBOLD,NOITALIC,NOUNDERLINE,0,0,0)
WinGetClientRect("",cx1,cy1,cx2,cy2)
SetRightMouse(cx1,cy1,cx2,cy2,RandomHelp,mx,my)
Index = 7
Wait_for_Input:
WaitInput()
Terminate:
{close the help windows, if present}
WinHTMLhelp("",SIBLING,QUIT,"",0,0,0,0)
WinHelp("PiXCL MDI Editor Help",QUIT,"")
End
Concept:
MessageBox(OK,1,INFORMATION,
"This sample shows how to access the traditional Windows HLP files, and
the new Windows 98 / 2000 HTML Help CHM files.
The client area is enabled for right mouse clicks to display a random message
in an HTMLHelp popup window.",
"PiXCL and Displaying Help files",Res)
Goto Wait_for_Input
ShowAppHelp:
WaitInput(1)
{An application Help file usually has the same name as the application.
Display both HLP and CHM for the MDI editor}
WinHelp("..\pxl_edit.hlp",CONTENTS,"")
WinHTMLhelp("..\pxl_edit.chm",SIBLING,CONTENTS,"",0,0,0,0)
{ {try these topics}
WinHTMLhelp("..\pxl_edit.chm",SIBLING,KEY,"MDI Editor Toolbar Buttons",0,0,0,0)
WinHTMLhelp("..\pxl_edit.chm",SIBLING,KEY,"Building a PiXCL executable",0,0,0,0)
}
Goto Wait_for_Input
RandomHelp:
WinGetLocation(Title$ ,ax1,ay1,ax2,ay2,Res)
Random(17,FontSize)
If FontSize < 6 Then FontSize = 6
Str(FontSize,FontSize$ ) Chr(13,cr$) Chr(34,qt$)
{charset = 0 std, 1 = alternative; 2 = graphics set }
{color = #00bbggrr Make a random hex colour}
Random(255,Red) Random(255,Green) Random(255,Blue)
NumToHex(Red,Red$)
NumToHex(Green,Green$)
NumToHex(Blue,Blue$)
FontColour$ = "#00"+ Red$ + Green$ + Blue$
FontString$ = "Verdana," + FontSize$ + ",," + FontColour$ + ",BOLD UNDERLINE"
mx += ax1 my += ay1 {adjust the client coords to screen coords}
Msg$ = "This is an HTML Help popup with a randomly sized and coloured default font. " +
"The content of the message can be varied each time."
WinHTMLhelp(Msg$, OWNED,POPUP,FontString$, mx,my,0,0)
Goto Wait_for_Input
About:
AboutUser(Title$,"Two lines of text goes here e.g. Application function.",
"Four Lines of additional information goes here, perhaps contact information and Web addresses")
Goto Wait_for_Input
ViewToolBar:
GetMenuStatus("&ToolBar",CHECKED,Res)
If Res = 0
GoSub MakeToolbar
ChangeMenuItem("&ToolBar",CHECK,Res)
Else
Toolbar()
ChangeMenuItem("&ToolBar",UNCHECK,Res)
Endif
Goto Wait_for_Input
ViewStatusBar:
GetMenuStatus("&StatusBar",CHECKED, Res)
If Res = 0
StatusWindow(ENABLE,BOTTOM,2,200,-1,0,0)
DrawStatusWinText(0,"Ready")
ChangeMenuItem("&StatusBar",CHECK,Res)
Else
StatusWindow(DISABLE,BOTTOM,2,200,-1,0,0)
ChangeMenuItem("&StatusBar",UNCHECK,Res)
Endif
Goto Wait_for_Input
CreatingFile:
WaitInput(1)
{TODO: add file handling here}
MessageBox(OK,1,INFORMATION,"No operations coded for this button.",
"Creating File",Res)
Goto Wait_for_Input
OpeningFile:
WaitInput(1)
{TODO: add file handling here}
MessageBox(OK,1,INFORMATION,"No operations coded for this button.",
"Opening File",Res)
Goto Wait_for_Input
SavingFile:
WaitInput(1)
{TODO: add file handling here}
MessageBox(OK,1,INFORMATION,"No operations coded for this button.",
"Saving File",Res)
Goto Wait_for_Input
PrintingFile:
WaitInput(1)
{TODO: add file handling here}
MessageBox(OK,1,INFORMATION,"No operations coded for this button.",
"Printing File",Res)
Goto Wait_for_Input
AcceptFile:
GetDragList(FileList$)
{TODO: add file list handling here, or delete this whole label handler}
Goto Wait_for_Input
ShowCmdInfo:
DrawBackground
UseFont("Verdana",7,0,NOBOLD,NOITALIC,NOUNDERLINE,0,0,0)
PXLCMDS(FixedArgs, VariableArgs)
Str(FixedArgs,FixedArgs$) Str(VariableArgs,VariableArgs$)
FixedArgs$ = "Number of FixedArgList commands = "+ FixedArgs$
VariableArgs$ = "Number of VariableArgList commands = "+ VariableArgs$
DrawText(15,40,FixedArgs$)
DrawText(15,70,VariableArgs$)
Goto Wait_for_Input
{--- Style Suggestion: place all subroutines at the end of the script.}
MakeToolbar: {subroutine}
Toolbar(RAISED, PXL_SMALL,
NULL, NULL, SEPARATOR, "", Wait_for_Input,
PXL_NEW, ENABLED, STD, "Create a new file", CreatingFile,
PXL_OPEN, ENABLED, STD, "Start and Check", OpeningFile,
PXL_SAVE, ENABLED, STD, "Test StrReplAll", SavingFile,
PXL_PRINT, ENABLED, STD,"Print", PrintingFile,
NULL, NULL, SEPARATOR, "", Wait_for_Input,
IMAGEINFO, ENABLED, STD,"PiXCL Cmd List", ShowCmdInfo,
HELPINFO, ENABLED, STD,"Show HLP and CHM Help files",ShowAppHelp)
Return